Don't try and close the pipe to the grandparent if it has already been closed
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Tue, 13 Dec 2005 00:10:19 +0000 (00:10 +0000)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Tue, 13 Dec 2005 00:10:19 +0000 (00:10 +0000)
(i.e. we have restarted Xend).

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/server/SrvDaemon.py

index 0a2075210009a33446b2499d10046b4c8c3a99f9..866990caf8b6e2b268afdf91564feaeb14593535 100644 (file)
@@ -167,8 +167,9 @@ class Daemon:
             while True:
                 pid = self.fork_pid()
                 if pid:
-                    os.close(w)
-                    w = False
+                    if w is not None:
+                        os.close(w)
+                        w = None
 
                     (_, status) = os.waitpid(pid, 0)